//
//  XJOrderDetailCell1.m
//  XinJiangMall
//
//  Created by RaoBo on 2018/6/21.
//  Copyright © 2018年 Tzyang. All rights reserved.
//

#import "XJOrderDetailCell1.h"
#import "XJOrderDetailCell1Model.h"

@interface XJOrderDetailCell1()
@property (weak, nonatomic) IBOutlet UIImageView *iconIV; //1.图片
@property (weak, nonatomic) IBOutlet UILabel *nameLb;//2.名字Lb
@property (weak, nonatomic) IBOutlet  UILabel *guigeLb; //3.规格label。默认hidden。如果规格有值在显示
@property (weak, nonatomic) IBOutlet UILabel *priceLB; //4.价格lb
@property (weak, nonatomic) IBOutlet UILabel *countLb; //5.购买数量lb


@end

@implementation XJOrderDetailCell1

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
    self.guigeLb.hidden = YES;
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


- (void)setCell1Model:(XJOrderDetailCell1Model *)cell1Model {
    _cell1Model = cell1Model;
    
    UIImage *placeholderImg = [UIImage imageNamed:@"default_goods"];
    [self.iconIV sd_setImageWithURL:[NSURL URLWithString:cell1Model.cover] placeholderImage:placeholderImg];
    
    self.nameLb.text = cell1Model.goods_name;
    self.countLb.text = [NSString stringWithFormat:@"x%@",cell1Model.quantity];
    self.priceLB.text = [NSString stringWithFormat:@"￥%@",cell1Model.price];
    
    if ([NSString isEmptyString:cell1Model.option_name]) {
        self.guigeLb.hidden = YES;
    }else {
        self.guigeLb.hidden = NO;
        self.guigeLb.text = cell1Model.option_name;
    }
}

@end
